Skip to content
QtWS25 Last Chance
  • Screen capture when using Wayland

    Unsolved Mobile and Embedded wayland screen capture
    2
    1 Votes
    2 Posts
    662 Views
    D
    Trying to do the same thing over here, @Johan-Borkhuis got any luck? Still couldn't find a good example and I don't want to make the Qt app to talk to weston-screenshooter for this
  • Resize A Picture When Print it

    Unsolved General and Desktop resize picture screen capture print
    8
    0 Votes
    8 Posts
    7k Views
    mrjjM
    @M4RZB4Ni yes, that is normal. Printer have many more pixels. so image seem smaller. Read docs. they have example of scaling stuff. This sample takes snapshot and scales it. void MainWindow::printshot() { QPixmap pix = QPixmap::grabWindow(QApplication::desktop()->winId()); QPrinter printer(QPrinter::HighResolution); printer.setOrientation(QPrinter::Landscape); QPainter painter; painter.begin(&printer); double xscale = printer.pageRect().width() / double(pix.width()); double yscale = printer.pageRect().height() / double(pix.height()); double scale = qMin(xscale, yscale); painter.translate(printer.paperRect().x() + printer.pageRect().width() / 2, printer.paperRect().y() + printer.pageRect().height() / 2); painter.scale(scale, scale); painter.translate(-width() / 2, -height() / 2); // note uses the form width/height! use pix.h/w if random image painter.drawPixmap(0, 0, pix); painter.end(); }
  • 0 Votes
    1 Posts
    1k Views
    No one has replied
  • Application window capture

    General and Desktop screen capture
    2
    0 Votes
    2 Posts
    974 Views
    JKSHJ
    Hi @alexsho, Use QWidget::grab()